package com.fc.entity.input;

import com.fc.checkGroup.Insert;
import com.fc.checkGroup.Update;
import com.fc.enums.UseStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class UserInput {

    @Schema(title = "id")
    @NotNull(message = "用户id不能为空", groups = Update.class)
    private Long id;

    @Schema(title = "姓名")
    @NotBlank(message = "用户姓名不能为空", groups = {Insert.class, Update.class})
    private String name;

    @Schema(title = "用户名")
    @NotBlank(message = "用户名不能为空", groups = {Insert.class, Update.class})
    private String username;

    @Schema(title = "密码")
    @NotBlank(message = "密码不能为空", groups = {Insert.class, Update.class})
    private String password;

    @Schema(title = "性别")
    @NotNull(message = "性别不能为空", groups = {Insert.class, Update.class})
    private Character sex;

    @Schema(title = "头像")
    @NotBlank(message = "头像不能为空", groups = {Insert.class, Update.class})
    private String image;

    @Schema(title = "联系电话")
    @NotBlank(message = "联系电话不能为空", groups = {Insert.class, Update.class})
    @Pattern(regexp = "^(|\\d{3}-\\d{8}|\\d{4}-\\d{7,8}|1[3-9]\\d{9})$", message = "手机号格式不正确", groups = {Insert.class, Update.class})
    private String phoneNumber;
}
